<%@ Page Language="C#" AutoEventWireup="true" StylesheetTheme="YUI" Theme="YUI" CodeFile="AttendancePatterns.aspx.cs"
    Inherits="Home_AttendancePatterns" %>

<%@ Register Src="../UserControls/Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Placement Manager: Attendance Patterns</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="doc3" class="yui-t7">
            <div id="hd">
                <uc1:Menu ID="Menu1" runat="server" />
            </div>
            <div id="bd">
                 <h1>Manage Attendance Patterns</h1>
                    <p>
                        Use this form to manage the available attendance patterns that can be associated
                        with a placement type. Atendance patterns are School or Division specific.</p>
                    <asp:GridView ID="gvAttendancePatterns" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        DataSourceID="odsAttendancePattern" SkinID="Results" OnRowUpdating="gvAttendancePatterns_RowUpdating"
                        AllowSorting="True" DataKeyNames="AttendancePatternId">
                        <Columns>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/Icons/against.gif"
                                EditImageUrl="~/Images/Icons/edit.gif" ShowEditButton="True" UpdateImageUrl="~/Images/Icons/refresh.gif" />
                            <asp:BoundField DataField="AttendancePatternName" HeaderText="Name" SortExpression="AttendancePatternName" />
                            <asp:BoundField DataField="CreatedBy" HeaderText="Created By" SortExpression="CreatedBy"
                                ReadOnly="True" />
                            <asp:BoundField DataField="DateCreated" HeaderText="Date Created" SortExpression="DateCreated"
                                ReadOnly="True" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                            <asp:BoundField DataField="UpdatedBy" HeaderText="Updated By" SortExpression="UpdatedBy"
                                ReadOnly="True" />
                            <asp:BoundField DataField="DateUpdated" HeaderText="Date Updated" SortExpression="DateUpdated"
                                ReadOnly="True" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                        </Columns>
                        <EmptyDataTemplate>
                            No placement categories have been defined for this Division.
                        </EmptyDataTemplate>
                    </asp:GridView>
                    <hr style="height: 1px;" />
                    <span class="formLabel">New Attendance Pattern Name:</span>
                    <asp:TextBox ID="txtNewAttendancePatternName" runat="server" MaxLength="255"></asp:TextBox>&nbsp;<asp:Button
                        ID="btnAddNewAttendancePattern" runat="server" CssClass="inputbutton" OnClick="btnAddNewAttendancePattern_Click"
                        Text="Add New Attendance Pattern" />&nbsp;
                    <asp:Label ID="lblNewAttendancePatternMessage" runat="server"></asp:Label>
            </div>
            <div id="ft">
                Footer
            </div>
        </div>
        <!--Object Data Sources ************************************************* -->
    <asp:ObjectDataSource ID="odsAttendancePattern" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectAllWDivisionId" TypeName="PlacementManager.AttendancePatternComponent"
        SortParameterName="sortExpression" DataObjectTypeName="PlacementManager.AttendancePattern"
        DeleteMethod="DeleteAllWDivisionId" InsertMethod="Insert" UpdateMethod="Update">
        <SelectParameters>
            <asp:SessionParameter Name="DivisionId" SessionField="DivisionId" Type="Int32" />
            <asp:Parameter DefaultValue="AttendancePatternName" Name="sortExpression" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="DivisionId" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="AttendancePatternName" Type="String" />
            <asp:Parameter Name="DivisionId" Type="Int32" />
            <asp:Parameter Name="IsActive" Type="Boolean" />
            <asp:Parameter Name="DateCreated" Type="DateTime" />
            <asp:Parameter Name="CreatedBy" Type="String" />
            <asp:Parameter Name="DateUpdated" Type="DateTime" />
            <asp:Parameter Name="UpdatedBy" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    </form>
</body>
</html>
